package unit5.part10;

public class ToStringTest {
    public static void main(String[] args) {
        System.out.println(new Car("迈巴赫"));
    }
}

class Car {
    String name;

    public Car(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Car{" +
                "name='" + name + '\'' +
                '}';
    }
}
